package com.daiyang.ioc.configuration;

import com.daiyang.ioc.medol.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class BeanConfig {

    @Bean(name={"u1","x2"})
    public User user1() {
        User user = new User();
        user.setName("代阳");
        user.setAge("18");
        return user;
    }

    @Bean(name={"u2","x1"})
    public User user2() {
        User user = new User();
        user.setName("陶镓妮");
        user.setAge("18");
        return user;
    }
}
